#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:6031)
#include<stdio.h>
#include"List.h"



int main(void) {
	List* list = create_list();
	if (!list) {
		printf("Error:creat_list failed.\n");
		exit(1);
	}

	//add_before_head(list, 1);
	//add_before_head(list, 2);
	//add_before_head(list, 3);
	//add_before_head(list, 4);//4-->3-->2-->1

	add_behind_tail(list, 1);
	add_behind_tail(list, 2);
	add_behind_tail(list, 3);
	add_behind_tail(list, 4);//1-->2-->3-->--4

	add_node(list, 0, 666);
	add_node(list, 2, 50);
	add_node(list, 6, 888);//666-->1-->50-->2-->3-->4-->888

	delete_node(list, 50);

	Node* node = find_by_index(list, 4);
	 printf("%d\n", node->data);

	//destroy_list(list);

	return 0;
}